package edu.gym4all.view;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

import com.example.gym4all.R;

import edu.gym4all.service.domain.Training;

public class MuscleTypeActivity extends Activity {

	public static String exerciseType = "";

	@Override
	public void onCreate(Bundle bundle) {
		super.onCreate(bundle);
		this.setContentView(R.layout.muscle_type_page);

		Button shoulderButton = (Button) this.findViewById(R.id.shoulderButton);
		shoulderButton.setOnClickListener(new OnClickShoulderButton(
				(Training) this.getIntent().getParcelableExtra("training")));

		Button chestButton = (Button) this.findViewById(R.id.chestButton);
		chestButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

			}
		});
		Button backButton = (Button) this.findViewById(R.id.backButton);
		backButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

			}
		});
		Button absButton = (Button) this.findViewById(R.id.absButton);
		absButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

			}
		});
		Button legButton = (Button) this.findViewById(R.id.legButton);
		legButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

			}
		});
		Button tricepsButton = (Button) this.findViewById(R.id.tricepsButton);
		tricepsButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

			}
		});
		Button bicepsButton = (Button) this.findViewById(R.id.bicepsButton);
		bicepsButton.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {

			}
		});
	}

	private class OnClickShoulderButton implements OnClickListener {

		private Training training;

		public OnClickShoulderButton(Training training) {
			this.training = training;
		}

		@Override
		public void onClick(View v) {
			Intent intent = new Intent(MuscleTypeActivity.this,
					HyperExercisesActivity.class);
			// intent.putExtra("exercise", "shoulder");
			MuscleTypeActivity.exerciseType = "shoulder";
			intent.putExtra("training", this.training);
			MuscleTypeActivity.this.startActivity(intent);
		}
	}
}